/*
 * @Author: linZeJian
 * @Date: 2022-04-26 15:21:17
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-04-26 17:24:13
 * @Description: 
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'

import 'element-ui/lib/theme-chalk/index.css'
import iconPicker from 'vue-fontawesome-elementui-icon-picker';
Vue.use(iconPicker);

import Vue2Editor from "vue2-editor";
Vue.use(Vue2Editor);

import FormMaking from './index'
Vue.use(FormMaking)

Vue.config.productionTip = false

Vue.use(ElementUI, {
  size: 'small'
})

import { isInIcestark, setLibraryName } from '@ice/stark-app';
setLibraryName('ice-app-form');

let vue

export function mount(props) {
  const { container } = props;
  vue = new Vue({
    router,
    mounted: () => {
    },
    destroyed: () => {
    },
    render: h => h(App),
  }).$mount();

  // for vue don't replace mountNode
  container.innerHTML = '';
  container.appendChild(vue.$el);
}

export function unmount() {
  if (vue) vue.$destroy();
  vue.$el.innerHTML = '';
  vue = null;
}


if(!isInIcestark()){
  new Vue({
    router,
    render: h => h(App)
  }).$mount('#app')
}

